#include "AudioClip.h"
using namespace AudioModel;
AudioClip::AudioClip(string path,FMOD::System &system)
{
	FMOD_RESULT result=system.createSound(path.c_str(), FMOD_2D | FMOD_SOFTWARE | FMOD_LOOP_NORMAL,0,&sound);
	if(AudioUtils::ERRCHECK(result))
		this->path=path;
	else exit(-1);
}

AudioClip::AudioClip(const AudioClip &clip)
{
	sound=clip.sound;
	this->path=clip.path;
}

AudioClip & AudioClip::operator=(const AudioClip& clip)
{
	sound=clip.sound;
	return *this;
}


AudioClip::~AudioClip(void)
{

}

string AudioClip::getPath()
{
	return path;
}

char * AudioClip::getName()
{
	char *name=new char[30];
	sound->getName(name,30);
    return name;
}

FMOD::Sound * AudioClip::getSound()
{
	return sound;
}
